package com.ruoyi.product.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 模板与规格属性的关联对象 product_spec_template_relation
 * 
 * @author liuhuizhong
 * @date 2025-08-07
 */
public class ProductSpecTemplateRelation extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 关联规格模板ID */
    @Excel(name = "关联规格模板ID")
    private Long templateId;

    /** 关联规格属性ID（关联product_spec表） */
    @Excel(name = "关联规格属性ID", readConverterExp = "关=联product_spec表")
    private Long productSpecId;

    private ProductSpec productSpec;

    /** 属性在模板中的排序 */
    @Excel(name = "属性在模板中的排序")
    private Long sort;

    /** 是否为模板必填属性（1-是，0-否） */
    @Excel(name = "是否为模板必填属性", readConverterExp = "1=-是，0-否")
    private Long isRequired;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setTemplateId(Long templateId) 
    {
        this.templateId = templateId;
    }

    public Long getTemplateId() 
    {
        return templateId;
    }
    public void setProductSpecId(Long productSpecId) 
    {
        this.productSpecId = productSpecId;
    }

    public Long getProductSpecId() 
    {
        return productSpecId;
    }
    public void setSort(Long sort) 
    {
        this.sort = sort;
    }

    public Long getSort() 
    {
        return sort;
    }
    public void setIsRequired(Long isRequired) 
    {
        this.isRequired = isRequired;
    }

    public Long getIsRequired() 
    {
        return isRequired;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("templateId", getTemplateId())
            .append("productSpecId", getProductSpecId())
            .append("sort", getSort())
            .append("isRequired", getIsRequired())
            .toString();
    }

    public ProductSpec getProductSpec() {
        return productSpec;
    }

    public void setProductSpec(ProductSpec productSpec) {
        this.productSpec = productSpec;
    }
}
